At present, big data processing technologies have been applied to many fields. In a big data processing scenario in which real-time analysis is required, a commonly used analysis system is a complex event processing (CEP) system. Pattern matching is one of important capabilities of the CEP system, and is mainly used to identify, according to a specific event, a perfect time for service execution in a real-time service scenario. In a matching process, matching is executed by a state machine instance of an event in a sliding window or a batch window. After an event occurs in a window, the CEP system needs to create a state machine instance for the event that occurs, and notify a state machine instance of an existing event in the window, of the event that newly occurs. The sliding window is used as an example. A decision condition of successful matching is that three events continuously occur, where the three events are an event 1, an event 2, and an event 3 according to a time sequence of occurrence. After the event 3 occurs, the CEP system creates a state machine instance corresponding to the event 3, and notifies created state machine instances of the event 1 and the event 2, of the occurrence of the event 3. The state machine instance of the event 1 performs matching, and determines that there are three events that have occurred in the window, and therefore the matching is successful. If the sliding window slides after the event 3 occurs, and the event 1 is out of the sliding window, the state machine instance of the event 2 performs matching, and determines that there are less than three events that have occurred in the window, and therefore the matching fails.
As a real-time service scenario becomes increasingly complex, a length of a window needs to be prolonged to cover more events. For example, a pattern matching function of the CEP system is used to select a user often suffering call drops, and it is determined that matching is successful if more than a specified quantity of call drop events continuously occur during a call. In an actual application, a time when a call drop event occurs is unpredictable, and the call drop event may occur at any time during an entire call. Therefore, in order to ensure that a matching process can cover a call drop event during a call, a length of a window needs to be prolonged to improve coverage of the window for call drop events during the call. However, a longer window may cover more events. If a long window covers a large quantity of events in a matching process, state machine instances that correspond to the events and need to be created by the CEP system increase greatly. Creating a state machine instance needs to occupy some memory resources, and therefore the CEP system needs to occupy a large quantity of memory resources to create the state machine instances for the events in the long matching window, which increases memory overheads when the CEP system performs pattern matching in a complex scenario.